import request from "@/utils/request";

// 查询题目列表
export function listQuestion(query) {
  return request({
    url: "/exam/question/list",
    method: "get",
    params: query,
  });
}

// 查询题目详细
export function getQuestion(questionId) {
  return request({
    url: "/exam/question/" + questionId,
    method: "get",
  });
}

// 新增题目
export function addQuestion(data) {
  return request({
    url: "/exam/question",
    method: "post",
    data: data,
  });
}

// 修改题目
export function updateQuestion(data) {
  return request({
    url: "/exam/question",
    method: "put",
    data: data,
  });
}
// 修改题目状态
export function updateQuestionStatus(questionId, status) {
  return request({
    url: "/exam/question/editStatus/" + questionId + "/" + status,
    method: "post",
  });
}

// 删除题目
export function delQuestion(questionId) {
  return request({
    url: "/exam/question/" + questionId,
    method: "delete",
  });
}
